#include "xyz.h"


/**
   @param paird is a one dimensional array of length ((count+1) *
   (count)) /2 It will contain the pairwise distance information once
   the call to calculate_pairwise_distances returns.

   @param sorted is a one dimensional array of length count.  It will
   contain the mapping from the unsorted array passed in by the user
   to the positions used in the paird array.

   @param center is the 'center' position.  More precisely, the
   distance function assumes that the 'correct' isomorphism between
   two neighborhoods relates the center positions with each other.

   @param positions is an array of xyz structs.  It does
   not include the center position, and is of length count

   @param count is the number of positions in the positions[] array.

   @see pairwise_distance_neighborhood_distances, pairwise_distance_neighborhood_get_array_size

   \ingroup Metric

   @todo Sorted should be a parameter, since the caller (almost always) needs it...)

*/
void pairwise_distance_neighborhood_calculate(short paird[], short sorted[], void * center, char * positions, short count, int object_size, double (*distance)(const void*,const void*));
/**
   @param a A paird array from calculate_pairwise_distances. 
   @param b The other paird array.
   @param array_size (count * (1+count))/2, where count is the number of neighbors in this neighborhood.  (Not including the center)
*/
double pairwise_distance_neighborhood_distances(short a[], short b[], short array_size);

/**
   @param count The number of neighbors in this neighborhood. (Not including the center)
   @return The number of entries in the paird array.
 */
int pairwise_distance_neighborhood_get_array_size(short count) ;
